-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Always set --no-canonical-prefixes if we can #7316
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some configurations of gcc (I suspect --without-sysroot is the key flag, but it's tricky to prove) will still resolve symlinks in the compiler path even when -fno-canonical-system-headers is used. This breaks remote execution in the presence of symlinks. There's not much we can do other than include both flags - it's hard to tell what will be correct when executing remotely. However, there appears to be no real harm in adding --no-canonical-prefixes if it passes the test in _is_linker_option_supported: prefix canonicalisation is only required when gcc is invoked through a symlink that does not also include the rest of its files, and the test command will fail completely when this occurs.
This should fix #7315 |
FYI, this broke Bazel's bootstrap on Ubuntu 14.04: #7605 (comment) |
bazel-io
pushed a commit
that referenced
this pull request
Mar 4, 2019
*** Reason for rollback *** Breaks protobuf when bootstrapping bazel (#7605) ERROR: /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/external/io_bazel/third_party/protobuf/3.6.1/BUILD:123:1: undeclared inclusion(s) in rule '@io_bazel//third_party/protobuf/3.6.1:protobuf_lite': this rule is missing dependency declarations for the following files included by 'external/io_bazel/third_party/protobuf/3.6.1/src/google/protobuf/stubs/bytestream.cc': '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/bytestream.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/common.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/port.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/platform_macros.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/macros.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/logging.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/mutex.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/callback.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/stringpiece.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/hash.h' *** Original change description *** Always set --no-canonical-prefixes if we can -no-canonical-prefixes should be enough in all cases except very old compilers. For those, we keep using -fno-canonical-system-headers Closes #7316. PiperOrigin-RevId: 236613108
katre
pushed a commit
that referenced
this pull request
Mar 4, 2019
*** Reason for rollback *** Breaks protobuf when bootstrapping bazel (#7605) ERROR: /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/external/io_bazel/third_party/protobuf/3.6.1/BUILD:123:1: undeclared inclusion(s) in rule '@io_bazel//third_party/protobuf/3.6.1:protobuf_lite': this rule is missing dependency declarations for the following files included by 'external/io_bazel/third_party/protobuf/3.6.1/src/google/protobuf/stubs/bytestream.cc': '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/bytestream.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/common.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/port.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/platform_macros.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/macros.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/logging.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/mutex.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/callback.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/stringpiece.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/hash.h' *** Original change description *** Always set --no-canonical-prefixes if we can -no-canonical-prefixes should be enough in all cases except very old compilers. For those, we keep using -fno-canonical-system-headers Closes #7316. PiperOrigin-RevId: 236613108
katre
pushed a commit
that referenced
this pull request
Mar 7, 2019
*** Reason for rollback *** Breaks protobuf when bootstrapping bazel (#7605) ERROR: /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/external/io_bazel/third_party/protobuf/3.6.1/BUILD:123:1: undeclared inclusion(s) in rule '@io_bazel//third_party/protobuf/3.6.1:protobuf_lite': this rule is missing dependency declarations for the following files included by 'external/io_bazel/third_party/protobuf/3.6.1/src/google/protobuf/stubs/bytestream.cc': '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/bytestream.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/common.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/port.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/platform_macros.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/macros.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/logging.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/mutex.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/callback.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/stringpiece.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/hash.h' *** Original change description *** Always set --no-canonical-prefixes if we can -no-canonical-prefixes should be enough in all cases except very old compilers. For those, we keep using -fno-canonical-system-headers Closes #7316. PiperOrigin-RevId: 236613108
katre
pushed a commit
that referenced
this pull request
Mar 7, 2019
*** Reason for rollback *** Breaks protobuf when bootstrapping bazel (#7605) ERROR: /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/external/io_bazel/third_party/protobuf/3.6.1/BUILD:123:1: undeclared inclusion(s) in rule '@io_bazel//third_party/protobuf/3.6.1:protobuf_lite': this rule is missing dependency declarations for the following files included by 'external/io_bazel/third_party/protobuf/3.6.1/src/google/protobuf/stubs/bytestream.cc': '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/bytestream.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/common.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/port.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/platform_macros.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/macros.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/logging.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/mutex.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/callback.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/stringpiece.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/hash.h' *** Original change description *** Always set --no-canonical-prefixes if we can -no-canonical-prefixes should be enough in all cases except very old compilers. For those, we keep using -fno-canonical-system-headers Closes #7316. PiperOrigin-RevId: 236613108
katre
pushed a commit
that referenced
this pull request
Mar 8, 2019
*** Reason for rollback *** Breaks protobuf when bootstrapping bazel (#7605) ERROR: /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/external/io_bazel/third_party/protobuf/3.6.1/BUILD:123:1: undeclared inclusion(s) in rule '@io_bazel//third_party/protobuf/3.6.1:protobuf_lite': this rule is missing dependency declarations for the following files included by 'external/io_bazel/third_party/protobuf/3.6.1/src/google/protobuf/stubs/bytestream.cc': '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/bytestream.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/common.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/port.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/platform_macros.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/macros.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/logging.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/mutex.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/callback.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/stringpiece.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/hash.h' *** Original change description *** Always set --no-canonical-prefixes if we can -no-canonical-prefixes should be enough in all cases except very old compilers. For those, we keep using -fno-canonical-system-headers Closes #7316. PiperOrigin-RevId: 236613108
katre
pushed a commit
that referenced
this pull request
Mar 13, 2019
*** Reason for rollback *** Breaks protobuf when bootstrapping bazel (#7605) ERROR: /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/external/io_bazel/third_party/protobuf/3.6.1/BUILD:123:1: undeclared inclusion(s) in rule '@io_bazel//third_party/protobuf/3.6.1:protobuf_lite': this rule is missing dependency declarations for the following files included by 'external/io_bazel/third_party/protobuf/3.6.1/src/google/protobuf/stubs/bytestream.cc': '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/bytestream.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/common.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/port.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/platform_macros.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/macros.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/logging.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/mutex.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/callback.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/stringpiece.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/hash.h' *** Original change description *** Always set --no-canonical-prefixes if we can -no-canonical-prefixes should be enough in all cases except very old compilers. For those, we keep using -fno-canonical-system-headers Closes #7316. PiperOrigin-RevId: 236613108
katre
pushed a commit
that referenced
this pull request
Mar 19, 2019
*** Reason for rollback *** Breaks protobuf when bootstrapping bazel (#7605) ERROR: /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/external/io_bazel/third_party/protobuf/3.6.1/BUILD:123:1: undeclared inclusion(s) in rule '@io_bazel//third_party/protobuf/3.6.1:protobuf_lite': this rule is missing dependency declarations for the following files included by 'external/io_bazel/third_party/protobuf/3.6.1/src/google/protobuf/stubs/bytestream.cc': '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/bytestream.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/common.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/port.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/platform_macros.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/macros.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/logging.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/mutex.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/callback.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/stringpiece.h' '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/hash.h' *** Original change description *** Always set --no-canonical-prefixes if we can -no-canonical-prefixes should be enough in all cases except very old compilers. For those, we keep using -fno-canonical-system-headers Closes #7316. PiperOrigin-RevId: 236613108
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some configurations of gcc (I suspect --without-sysroot is the key
flag, but it's tricky to prove) will still resolve symlinks in the
compiler path even when -fno-canonical-system-headers is used. This
breaks remote execution in the presence of symlinks.
There's not much we can do other than include both flags - it's hard
to tell what will be correct when executing remotely. However, there
appears to be no real harm in adding --no-canonical-prefixes if it
passes the test in _is_linker_option_supported: prefix
canonicalisation is only required when gcc is invoked through a
symlink that does not also include the rest of its files, and the test
command will fail completely when this occurs.